package com.xl.controller;

import com.xl.annotation.SystemLog;
import com.xl.domain.entity.ResponseResult;
import com.xl.domain.entity.User;
import com.xl.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @SystemLog(businessName = "查询个人信息")
    @GetMapping("/userInfo")
    public ResponseResult userInfo() {
      return userService.userInfo();
    }
    @PutMapping("/userInfo")
    @SystemLog(businessName = "更新用户信息")
    public ResponseResult  updateUserInfo(@RequestBody User user){
        //更新个人信息
        return userService.updateUserInfo(user);
    }
    @SystemLog(businessName = "用户注册")
    @PostMapping("/register")
    public ResponseResult register(@RequestBody User user){

        return userService.register(user);
    }


}
